package com.xt.xxb.task;

import com.xt.xxb.Main;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

/**
 * 心跳机制
 */
public class HeartbeatRunnable implements Runnable {
    @Override
    public void run() {
        boolean login = Main.isLogin();
        if (!login) {
            return;
        }
        Main.heartbeat();
        Main.logger("心跳检测");
        if (RandomUtils.nextBoolean()) {
            Main.clear();
        }
    }
}
